home *** CD-ROM | disk | FTP | other *** search
- Path: news.rain.org!usenet
- From: "Guus Leeuw jr." <guusl@eiffel.com>
- Newsgroups: comp.lang.c
- Subject: Re: My last chance....Format Routine
- Date: Thu, 29 Feb 1996 10:44:29 -0800
- Organization: Interactive Software Engineering Inc. http://www.eiffel.com/
- Message-ID: <3135F40D.665F4782@eiffel.com>
- References: <1996Feb29.091821.1500@es.dupont.com>
- NNTP-Posting-Host: @outback.eiffel.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (X11; I; Linux 1.2.8 i586)
-
- Malcolm Smart wrote:
- >
- > I've posted this to the COMP.OS.DOS etc groups with no joy.
- >
- > Does anyone know of a c routine to format a floppy disk? My client
- > wishes to remove program manager from the windows setup, but still wishes
- > to allow users to format floppies.
- >
-
- You might have a look at the `system()' function from `stdlib.h'.
-
- In your case you will call it like:
-
- #include <stdlib.h>
-
- int main()
- {
- if((system("format a:")) == -1)
- {
- /* Check the error */
-
- return 0;
- }
-
- return 1;
- }
-
- Regards,
- Guus
-
- PS: Commandment 7 says: "Thou shalt study thy libraries and strive not to reinvent
- them without cause, that thy code may be short and readable and thy days pleasant and
- productive."
-
- PPS: And of course, FAQ 19.27 has some explanation on system()
-